library(DeclareDesign)
library(tidyverse)
library(rdss)
library(scales)


diagnosis_16.1 <- read_rds("diagnosis_objects/diagnosis_16.1.rds")

gg_df <- 
  diagnosis_16.1 |> 
  tidy() |> 
  filter(diagnosand == "rmse")

g <- 
  ggplot(gg_df) + 
  aes(term, estimate) +
  geom_linerange(aes(ymin = conf.low, ymax = conf.high)) +
  geom_point() +  
  facet_wrap(~XY) + 
  theme_dd() + 
  labs(x = "Strategy", y = "Root mean squared error")

ggsave("figures/figure_16.2.svg",
       g,
       width = 6.5,
       height = 2.5)
ggsave("figures/figure_16.2.pdf",
       g,
       width = 6.5,
       height = 2.5)
